#ifndef __MRECT_H__
#define __MRECT_H__

#include <ostream>
#include <fstream>

#include "MPoint.h"
#include "MSize.h"

class MRect
{
public:
	MRect( float x = 0.0f, float y = 0.0f, float width = 0.0f, float height = 0.0f );
	MRect( MPoint point, MSize size );
	MRect( const MRect& rect );
	MRect& operator = ( const MRect& rect );

	bool isPointInRect( MPoint point );

	~MRect();

	void	setX( float x );
	float	x() const;

	void	setY( float y );
	float	y() const;

	void	setWidth( float width );
	float	width() const;

	void	setHeight( float height );
	float	height() const;

	void	setPoint( MPoint point );
	MPoint	point() const;

	void	setSize( MSize size );
	MSize	size() const;

	MRect operator + ( const MRect& rect );
	MRect& operator += ( const MRect& rect );
	MRect operator - ( const MRect& rect );
	MRect operator * ( const MRect& rect );
	MRect operator / ( const MRect& rect );
	bool	operator > ( const MRect& rect );
	
	friend std::ostream& operator << ( std::ostream& stream, const MRect& rect );
	friend std::wofstream& operator << ( std::wofstream& stream, const MRect& rect );

	MRect operator + ( float n );
	MRect operator - ( float n );
	MRect operator * ( float n );
	MRect operator / ( float n );
	bool	operator > ( float n );
private:
	MPoint	_point;
	MSize	_size;
};

MRect abs( MRect& rect );

#endif